/*
 * @Author: GerhardYang
 * @Date: 2021-08-24 16:55:59
 * @LastEditors: 予程_hepch
 * @LastEditTime: 2022-06-21 18:40:29
 * @Description: file content
 */
import axios from "axios";
const esPost = (url, params) => {
  return new Promise((resolve, reject) => {
    axios
      .post(url, params, {
        auth: {
          username: "elastic",
          password: "Supermap@123",
        },
      })
      .then((res) => {
        if (res.status !== 200 && res.status !== 201) {
          console.error("ES post 查询失败！");
        } else {
          let data = res.data;
          resolve(data);
          reject();
        }
      });
  });
};

export { esPost };
